
package com.github.ybq.parallaxviewpager.Interpolator;

import ohos.agp.components.AttrSet;
import ohos.app.Context;

/**
 * Accelerate decelerate interpolator
 */
public class AccelerateDecelerateInterpolator extends BaseInterpolator {
    /**
     * Accelerate decelerate interpolator
     */
    public AccelerateDecelerateInterpolator() {
    }

    /**
     * Accelerate decelerate interpolator
     *
     * @param context context
     * @param attrs   attrs
     */
    public AccelerateDecelerateInterpolator(Context context, AttrSet attrs) {
    }

    /**
     * Get interpolation float
     *
     * @param input input
     * @return the float
     */
    public float getInterpolation(float input) {
        return (float) ((Math.cos((input + 1) * Math.PI) / 2.0f) + 0.5f);
    }

}